// 统一请求路径前缀在libs/new-axios.js中修改
import { getRequest, postRequest, putRequest, getNoAuthRequest, postNoAuthRequest, deleteRequest } from '@/libs/new-axios.js';

export const uploadFile = "/api-file/files-anon"

/**
 * 帖子模块
 * */

// 获取帖子列表
export const getPostList = (params) => {
    return getRequest('-post/back/post/getBackPostList', params)
}

// 获取帖子详情
export const getPostDetail = (params) => {
    return getRequest('-post/back/post/getBackPostDetail', params)
}

// 移除帖子
export const removePostById = (params) => {
    return postRequest('-post/back/post/removePost', params)
}

// 获取帖子评论列表
export const getCommentByPostId = (params) => {
    return getRequest('-post/back/post/getPostComment', params)
}

// 置顶帖子
export const topPostById = (params) => {
    return postRequest('-post/back/post/topPost', params)
}

// 设置帖子为轮播图
export const setSwiperPostById = (postId) => {
    return postRequest(`-post/back/post/settingBanner/${postId}`, {})
}

// 新增或修改话题贴
export const addOrEditTopic = (data) => {
    return postRequest('-post/back/post/publishTopicPost', data)
}

// 删除评论
export const delCommentById = (params) => {
	return postRequest('-comment/back/comment/removeComment', params)
}


/**
 * 上新模块
 * */
 
// 获取上新列表
export const getNewList = (params) => {
	return getRequest('-post/back/newGood/getBackNewGoodList', params)
}

// 获取上新详情
export const getNewDetail = (params) => {
	return getRequest('-post/back/newGood/getBackNewGoodDetail', params)
}

// 添加或编辑上新信息
export const insertOrUpdateNew = (params) => {
	return postRequest('-post/back/newGood/saveOrUpdateNewGood', params)
}

// 移除上新信息
export const removeNewById = (id) => {
	return deleteRequest(`-post/back/newGood/removeNewGood/${id}`, {})
}

// 获取订阅用户列表
export const getCallUserList = (params) => {
	return getRequest('-post/back/newGood/getNewGoodSubscriberUserList', params)
}

// 获取上新评论列表
export const getNewComment = (params) => {
	return getRequest('-post/back/newGood/getBackNewGoodCommentList', params)
}

/**
 * 抽奖模块
 * */
 
// 获取全部抽奖分类
export const getAllClassifyData = () => {
	return getRequest('-product/back/drawCategory/getAll', {})
}

// 添加或编辑抽奖分类
export const insertUpdateClassify = (params) => {
	return postRequest('-product/back/drawCategory/saveOrUpdateDrawCategory', params)
}

// 删除抽奖分类
export const removeClassify = (params) => {
	return postRequest('-product/back/drawCategory/delAllByIds', params)
}

// 获取抽奖组列表
export const getDrawProductData = (params) => {
	return getRequest('-product/back/drawProductGroup/getDrawProductList', params)
}

// 获取抽奖组详细信息
export const getDrawProductDetailById = (params) => {
	return getRequest('-product/back/drawProductGroup/getDrawProductGroupDetail', params)
}

// 保存抽奖组
export const saveDrawProduct = (params) => {
	return postRequest('-product/back/drawProductGroup/saveDrawProductGroup', params)
}

// 编辑抽奖组
export const editDrawProduct = (params) => {
	return postRequest('-product/back/drawProductGroup/updateDrawProductGroup', params)
}

// 移除抽奖组
export const removeDrawProduct = (params) => {
	return postRequest('-product/back/drawProductGroup/removeDrawProductGroup', params)
}

// 设置抽奖组为轮播图
export const setDrawProductSwiper = (id) => {
	return postRequest(`-product/back/drawProductGroup/settingBanner/${id}`, {})
}

// 获取0元抽奖列表
export const getLotteryList = (data) => {
	return getRequest('-product/back/zeroDraw/getBackZeroDrawPage', data)
}

// 新增或修改0元抽奖
export const insertOrUpdateLottery = (data) => {
	return postRequest('-product/back/zeroDraw/saveOrUpdateZeroDraw', data)
}

// 移除0元抽奖
export const removeLotteryByIds = (ids) => {
	return deleteRequest(`-product/back/zeroDraw/removeZeroDraw/${ids}`, {})
}

// 查看0元抽奖订阅用户
export const getLotteryCallUsers = (data) => {
	return getRequest('-product/back/zeroDraw/getSubscribeList', data)
}

// 设置0元抽奖中奖用户
export const setLotteryUsers = (data) => {
	return postRequest('-product/back/zeroDraw/getSubscribeList', data)
}


/**
 * 山正鉴定模块
 * */

// 获取山正鉴定列表
export const getAppraisalData = (params) => {
	return getRequest('-post/back/authenticate/getBackAuthenticateList', params)
}

// 获取山正鉴定详情
export const getAppraisalDetailById = (params) => {
	return getRequest('-post/back/authenticate/getBackAuthenticateDetail', params)
}

// 设置山正鉴定评测结果
export const setAppraisalResult = (params) => {
	return putRequest('-post/back/authenticate/settingAuthenticateResult', params)
}

// 获取山正鉴定评论列表
export const getAppraisalCommentData = (params) => {
	return getRequest('-post/back/authenticate/getBackAuthenticateCommentList', params)
}